﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.daowen.bll.*,com.daowen.util.PagerMetal"%>
<%@ page import="com.daowen.entity.*" %>
<%@page import="com.daowen.dal.DALBase"%>
<%@ page import="java.text.*"%>
<%@ include file="law.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="daowen" uri="/daowenpager"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>线路分类信息</title>
    <script src="<%=SystemParam.getSiteRoot() %>/webui/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
    <link href="<%=SystemParam.getSiteRoot() %>/webui/artDialog/skins/default.css" rel="stylesheet" type="text/css" />
    <script src="<%=SystemParam.getSiteRoot() %>/webui/artDialog/jquery.artDialog.source.js" type="text/javascript"></script>
    <script src="<%=SystemParam.getSiteRoot() %>/webui/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script src="<%=SystemParam.getSiteRoot()%>/webui/combo/combo.js" type="text/javascript"></script>
    <link href="<%=SystemParam.getSiteRoot() %>/webui/treetable/skin/jquery.treetable.css" rel="stylesheet" type="text/css" />
    <link href="<%=SystemParam.getSiteRoot() %>/webui/treetable/skin/jquery.treetable.theme.default.css" rel="stylesheet"
        type="text/css" />
    <script src="<%=SystemParam.getSiteRoot() %>/webui/treetable/js/jquery.treetable.js" type="text/javascript"></script>
     <link href="<%=SystemParam.getSiteRoot() %>/admin/css/web2table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			$(function() {
			    
			});
       </script>
	</head>
	 <body >
	<div class="search-title">
		<h2>线路分类管理</h2>
		<div class="description">
			<a
				href="<%=SystemParam.getSiteRoot() %>/admin/xltypemanager.do?actiontype=load&forwardurl=/admin/xltypeadd.jsp">新建线路分类</a>
		</div>
	</div>
	<!-- 搜索控件开始 -->
	<div class="search-options">
		<form id="searchForm"
			action="<%=SystemParam.getSiteRoot() %>/admin/xltypemanager.do"
			method="post">
			<table cellspacing="0" width="100%">
				<tbody>
					<tr>
						<td>名称 <input name="name" value="${name}" class="input-txt"
							type="text" id="name" /> <input type="hidden" name="actiontype"
							value="search" /> <input type="hidden" name="seedid"
							value="${seedid}" /> <input type="hidden" name="forwardurl"
							value="/admin/xltypemanager.jsp" />

							<button class="orange-button">搜索</button>

						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
	<!-- 搜索控件结束 -->
	<div class="clear"></div>
	<div class="action-details">
		<a href="#" class="btn btn-success" id="btnCheckAll"
			class="action-button">选择</a> <a id="btnDelete" class="action-btn"
			href="#"> <em class="icon-delete"></em> <b>删除</b>
		</a>
	</div>
	<table id="xltype" width="100%" border="0" cellspacing="0"
		cellpadding="0" class="ui-record-table">
		<thead>
			<tr>
				
				<th><b>名称</b></th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${listxltype== null || fn:length(listxltype) == 0}">
				<tr>
					<td colspan="20">没有相关线路分类信息</td>
				</tr>
			</c:if>
			<%	
								        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
									if(request.getAttribute("listxltype")!=null)
								      {
									  List<Xltype> listxltype=( List<Xltype>)request.getAttribute("listxltype");
								     for(Xltype  temxltype  :  listxltype)
								      {
							%>
			<tr>
				
				<td><%=temxltype.getName()%></td>
				<td>  <%
							     boolean isexist=DALBase.isExist("sitenav", MessageFormat.format("where title=''{0}''",temxltype.getName()));  
							     if(!isexist){
							    	
							  %>
							      <form name="sitenavform" method="post"
										action="<%=SystemParam.getSiteRoot()%>/admin/sitenavmanager.do">
										
									<input type="hidden" name="actiontype" value="save" />
									
									<input type="hidden" name="title" value="<%=temxltype.getName() %>" />
									<input type="hidden" name="errorurl" value="/admin/snxltypeguide.jsp" />
									<input type="hidden" name="sindex" value="1" />
									
									<input type="hidden" name="href" value="/e/xianlulist.jsp?typeid=<%=temxltype.getId()%>"/>
									<input type="hidden" name="forwardurl"
										value="/admin/sitenavmanager.do?actiontype=get&forwardurl=/admin/sitenavmanager.jsp" />
										<button class="orange-href"><img src="images/add.gif">加入导航</button>
							         
								   
								   </form>
							  <%}else{%>
							              <span class="orange-href">已加入</span>
							  <%} %>

				</td>
			</tr>
			<%}}%>
		</tbody>
	</table>
	<div class="clear"></div>
	<daowen:pager id="pager1" attcheform="searchForm" />
</body>
</html>
